home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
e
/
AEPD09.lha
/
EPD09
/
Amiga_E-Programme
/
ESEE
/
GoldED
/
Parsers
/
PROC.devpac
< prev
Wrap
Text File
|
1994-08-18
|
2KB
|
59 lines
*
* PROC.devpac - by Leon Woestenberg 1993, fully public domain.
* ~~~~~~~~~~~
* Description
* ~~~~~~~~~~~
* ESEE 'PROC' Section Parser in assembly language.
*
* Function
* ~~~~~~~~
* Can be called by GoldED to parse one line for PROC indexing.
*
* Input (comes from GoldED)
* ~~~~~
* a0 - address of stringpointer to line
* d0 - length of the line
*
* Output (goes to GoldED)
* ~~~~~~
* a0 - address of stringpointer to functionname
* d0 - length of functionname
*
* GoldED Settings
* ~~~~~~~~~~~~~~~
* It's advicable to set the file extension to '*.e' for this parser. This
* can be done in GoldED's Sections window called by GoldED's FUNC command.
*
move.l a1,-(a7) * store a1
move.l (a0),a1 * stringpointer to a1
cmp.b #80,(a1) * char P?
bne not
cmp.b #82,1(a1) * char R?
bne not
cmp.b #79,2(a1) * char O?
bne not
cmp.b #67,3(a1) * char C?
bne not
cmp.b #32,4(a1) * space?
bne not
add.l #5,a1 * stringpointer to functionname
add.l #5,(a0) * idem dito
move.l d0,d1 * copy string length to d1
clr.l d0 * initialize d0 for search
find:
cmp.b #40,(a1) * char (?
beq end
add.l #1,a1 * increase charpointer
add.l #1,d0 * increase length
cmp.b d0,d1 * line length reached?
beq not
jmp find * check next char
not:
clr.l d0 * no success, return zero
end:
move.l (a7)+,a1 * restore a1
rts * bye bye